
<template>
	<view v-if="options.title"  @click="click">
		<view class="cu-card article no-card" >
			<view class="cu-item shadow" style="padding: 20rpx 40rpx 0 40rpx;" >
				<view v-if="options.showType==1||options.showType==0" class="notice-title"><view  style="font-size: 32rpx;">{{options.shortTitle?options.shortTitle:options.title}}</view></view>
				<view v-if="options.showType==1&&options.imgList" class="notice-content">
					<image v-if="options.imgList.length>=3&&index<3" v-for="(item,index) in options.imgList" :key="index" :src="item.url" style="width: 33.3%;height: 5.4em;" :style="index<2?'margin-right: 20rpx;':''"
					 mode="aspectFill"></image>
					<image v-if="options.imgList.length==1&&index==0" v-for="(item,index) in options.imgList" :key="index" style="width: 100%;height: 11.4em;" :src="item.url"
					 mode="aspectFill"></image>
					<image v-if="options.imgList.length==2&&index<2" v-for="(item,index) in options.imgList" :key="index" style="width: 50%;height: 7.4em;" :src="item.url" :style="index<1?'margin-right: 20rpx;':''"
					  mode="aspectFill"></image>
				</view>
				<view  v-if="options.showType==2"  class="notice-content">
					<image v-if="options.imgList&&index==0" v-for="(item,index) in options.imgList" :key="index" style="width: 280rpx;height: 5.4em;padding-right: 20rpx;" :src="item.url"
					 mode="aspectFill"></image>
					<view  class="notice-title" style="font-size: 32rpx;">{{options.shortTitle?options.shortTitle:options.title}}</view>
				</view>
				<view style="display: flex;position: relative;align-items: center;justify-content: space-between;border-bottom: 1rpx solid #eee;">
					<view class="text-gray text-sm text-left notice-padding" style="display: flex;position: relative;align-items: center;justify-content: flex-start;">
						<view class="text-cut" style="width: 260rpx;" >{{options.publisher}}</view>
						<text class="basefont icon-eye-fill text-gray" style="padding: 0 5rpx 0 10rpx;"></text> {{options.showCount?(options.showCount>999?'999+':options.showCount):'0'}}
						<text class="basefont icon-like-fill " style="padding: 0 5rpx 0 10rpx;" :class="options.likeFlag?'text-red':'text-gray'"></text> {{options.likeCount?(options.likeCount>999?'999+':options.likeCount):0}}
						<text class="basefont icon-message-fill  text-gray" style="padding: 0 5rpx 0 10rpx;"></text> {{options.commentCount?(options.commentCount>999?'999+':options.commentCount):0}}
					</view>
					<view class="text-gray text-sm text-right notice-padding" >
						<text>{{options.publishTimeText}}</text>
					</view>
				</view>
				
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			options: {
				type: Object,
				default: function(e) {
					return {}
				}
			},
			closeFlag:{
				type: Boolean,
				default:false
			}
		},
		methods: {
			click() {
				this.$emit('click',this.options);
			},
			close(e) {
				this.$emit('close');
			}
		}
	}
</script>

<style>
	.notice-title {
		color: #555555;
		line-height: 60rpx;
	}
	.notice-content {
		display: flex;
	}
	.cu-card.article>.cu-item .notice-content>image {
		width: 240rpx;
		height: 6.4em;
		border-radius: 6rpx;
	}
	
	.notice-padding {
		padding: 20rpx 0 20rpx 0;
	}
</style>
